var html = ""
var shiyan = document.querySelector(".shiyishi");
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://localhost:3000/javascripts/libs/data.json");
xhr.send(null);
xhr.onreadystatechange = function () {
    if (xhr.readyState === 4) {
        var res = JSON.parse(xhr.responseText);
        var data_ = []
        for (var data in res) {
            // console.log(data)

            data_.push(data)


        };
        for (var i = 0; i < data_.length; i++) {
            // console.log(data_[i].goodsMainPic)
            var shenglue = res[data_[i]].goodsName.replace("【2020新品】", "")
            html += `<div class="commodity">
                 <a class="commodity_img" href=" https://store.lining.com/shop/goods-${res[data_[i]].uid}.html">
                
                     <img src="https://cdns.lining.com/postsystem/docroot/images/goods/${res[data_[i]].goodsMainPic}" alt="">
                 </a>
                 
                 <div class="describe">
                 ${shenglue}
                 </div>
                 <div class="price">
                        <div class="price_left">
                             <div class="money">￥</div>
                             <div class="money_nu"><strong>399元</strong> </div>
                        </div>
                        <div class="price_right">
                            <img src="https://cdns.lining.com/postsystem/docroot/images/promotion/201803/buyitnow.png" alt="">
                            </div>
                        </div>
                 </div>`
        }

        shiyan.innerHTML = html;
    }
} 
